//
//  ALPPlayView.m
//  AlpFM
//
//  Created by KING on 16/1/28.
//  Copyright © 2016年 Alp. All rights reserved.
//

#import "ALPPlayView.h"
#import "UIImage+Blur.h"
//屏幕宽
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
//屏幕高
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
@implementation ALPPlayView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}
- (void)createSubViews{
    //背景的图片
    self.backgroundImage = [[UIImageView alloc] initWithFrame:self.bounds];
    UIImage *image = [UIImage imageNamed:@"mm"];
    self.backgroundImage.image = [image boxblurImageWithBlur:0.8];
    [self addSubview:self.backgroundImage];
    
    //音乐的图片
    self.musicImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 0.6*SCREEN_WIDTH, 0.66*SCREEN_WIDTH)];
    self.musicImage.image = [UIImage imageNamed:@"min"];
    self.musicImage.center = CGPointMake(SCREEN_WIDTH / 2, SCREEN_HEIGHT *0.34);
    [self.backgroundImage addSubview:self.musicImage];
    
    //title
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.21*SCREEN_WIDTH, 0.07*SCREEN_WIDTH, 0.53*SCREEN_WIDTH, 0.1*SCREEN_WIDTH)];
    self.titleLabel.text = @"专题";
    //    self.titleLabel.textColor = WHITE;
//    self.titleLabel.backgroundColor = CLEAR;
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = [UIFont boldSystemFontOfSize:0.040*SCREEN_WIDTH];
    [self addSubview:self.titleLabel];
    
    //作者的底层view
    UIImageView *baseView  = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0.82*SCREEN_HEIGHT-64, SCREEN_WIDTH, (1-0.82)*SCREEN_HEIGHT)];
//    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
////        baseView.backgroundColor = COLOR_BTN_NIGHT;
//    } else {
//        baseView.backgroundColor = COLOR_BG;
//    }
    [self addSubview:baseView];
    
    //作者的图片
    self.edictorImage = [[UIImageView alloc] initWithFrame:CGRectMake(0.08*SCREEN_WIDTH, 0.85*SCREEN_HEIGHT-4, 0.2*SCREEN_WIDTH, 0.2*SCREEN_WIDTH)];
    self.edictorImage.image = [UIImage imageNamed:@"girledg"];
    self.edictorImage.layer.masksToBounds = YES;
    self.edictorImage.layer.cornerRadius = 0.1*SCREEN_WIDTH;
    [self addSubview:self.edictorImage];
    
    //作者的title
    self.edictorLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.32*SCREEN_WIDTH, 0.85*SCREEN_HEIGHT-4, 200, 40)];
    self.edictorLabel.text = @"专家";
//    self.edictorLabel.backgroundColor = CLEAR;
    self.edictorLabel.font = [UIFont systemFontOfSize:0.039*SCREEN_WIDTH];
    [self addSubview:self.edictorLabel];
//    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
//        self.edictorLabel.textColor = WHITE;
//    } else {
//        self.edictorLabel.textColor = BLACK;
//    }
    
    //作者的subTitle
    self.edictorSubLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.32*SCREEN_WIDTH, 0.9*SCREEN_HEIGHT-4, 200, 40)];
    self.edictorSubLabel.text = @"今天想说些什么";
//    self.edictorSubLabel.backgroundColor = CLEAR;
    self.edictorSubLabel.font = [UIFont systemFontOfSize:0.037*SCREEN_WIDTH];
    [self addSubview:self.edictorSubLabel];
//    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
//        self.edictorSubLabel.textColor = WHITE;
//    } else {
//        self.edictorSubLabel.textColor = BLACK;
//    }
    
    
    
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
